package org.footballmanager.pandafootball.system.form.impl;

import lombok.Getter;
import lombok.Setter;
import org.footballmanager.pandafootball.system.domain.FootRank;
import org.footballmanager.pandafootball.system.form.SearchForm;
import org.springframework.util.StringUtils;
import tk.mybatis.mapper.entity.Example;

import java.io.Serializable;

@Getter
@Setter
public class FootRankSearchForm extends SearchForm implements Serializable {
	private static final long serialVersionUID = 8090668615941861537L;
	protected String userName;
	protected Long sj;

	public Example buildSearchCommond() {
		Example example = new Example(FootRank.class);
		Example.Criteria criteria = example.createCriteria();
		if(!StringUtils.isEmpty(sj)){
		    criteria.andEqualTo("sj", sj);
		}
        criteria.andEqualTo("delFlag", 0);
        example.orderBy("jf desc, jsq desc, jq desc");
		return example;
	}

}
